package API.Collection.List.ArrayList.Basis.test;

import java.util.ArrayList;
import java.util.Scanner;

public class TraverseWithInport {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Student> list = new ArrayList<>();
        System.out.println("请输入你要录入的学生的个数");
        int num = sc.nextInt();
        for (int i = 0; i < num; i++) {
            System.out.println("请输入第" + (i + 1) + "个学生的数据");
            Student stu = new Student(sc.next(),sc.nextInt());
            list.add(stu);
        }
        for (Student student : list) {
            System.out.println(student.toString());
        }
    }
}
